<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"
                xmlns:pe="http://primefaces.org/ui/extensions">


    <ui:define name="content">

        <h:panelGroup rendered="true" >
            <h:form>
                <p:panel id="reportPrint" header="Casheir Session Report Detail">

                    <f:facet name="header" >
                        <h:outputLabel value="#{commonReport.webUser.institution.name}"/> <br/>
                        <h:outputLabel value="Cashier Detailed Report - Opd Bills -&nbsp;&nbsp; #{commonReport.webUser.webUserPerson.name}"/>
                        <p:commandButton ajax="false" value="Refresh" styleClass="noPrintButton" style="float: right;" />  
                        <p:commandButton ajax="false" value="Print" styleClass="noPrintButton" style="float: right;" >
                            <p:printer target="reportPrint" />
                        </p:commandButton>  

                        <p:commandButton value="Export as Excel" ajax="false" styleClass="noPrintButton" action="report_cashier_detailed_by_user_print" style="float: right;" >
                          
                        </p:commandButton>    
                    </f:facet>


                    <p:panelGrid columns="6" styleClass="noPrintButton" >
                        <h:outputLabel value="From Date"/>
                        <p:calendar id="frmDate" value="#{commonReport.fromDate}" navigator="true"  pattern="dd MMMM yyyy HH:mm:ss" >
                        </p:calendar>

                        <h:outputLabel value="To Date"/>
                        <p:calendar id="toDate" value="#{commonReport.toDate}" navigator="true" pattern="dd MMMM yyyy HH:mm:ss" >
                        </p:calendar>
                        <h:outputLabel styleClass="noPrintButton" value="User Name"/>
                        <p:autoComplete forceSelection="true" converter="webUs" completeMethod="#{webUserController.completeUser}" styleClass="noPrintButton"
                                        var="w" itemLabel="#{w.webUserPerson.name}" itemValue="#{w}"
                                        value="#{commonReport.webUser}" ></p:autoComplete>
                    </p:panelGrid>



                    <ez:tableBilledBill   bill="#{commonReport.userBillsOwn}" id="tbl" />

                    <p:spacer height="30"/>
                    <ez:tableCancelledBill bill="#{commonReport.userCancelledBillsOwn}"/>
                    <p:spacer height="30"/>
                    <ez:tableRefundBill bill="#{commonReport.userRefundedBillsOwn}"/>
                    <p:spacer height="30"/>
                    <ez:tablePaymentBill bill="#{commonReport.userPaymentBillsOwn}"/>
                    <p:spacer height="30"/>
                    <ez:tablePaymentCancel bill="#{commonReport.userPaymentCancelBillsOwn}" />
                    <p:spacer height="30"/>
                    <ez:tablePettyPayment bill="#{commonReport.userPettyPaymentBills}" />
                    <p:spacer height="30"/>
                    <ez:tablePettyCancel bill="#{commonReport.userPettyPaymentCancelBills}"/>
                    <p:spacer height="30"/>
                    <ez:tableCompanyPayment bill="#{commonReport.userCashRecieveBills}"/>
                    <p:spacer height="30"/>
                    <ez:tableCompanyCancel bill="#{commonReport.userCashRecieveBillCancel}"/>
                    <p:spacer height="30"/>
                    <ez:tableAgentPayment bill="#{commonReport.userAgentRecieveBills}" />
                    <p:spacer height="30"/>
                    <ez:tableAgentCancel bill="#{commonReport.userAgentRecieveBillCancel}"/>
                    <p:spacer height="30"/>             
                    <ez:tableInwardPaymentBill bill="#{commonReport.userInwardPaymentBillsOwn}"/>
                    <p:spacer height="30"/>
                    <ez:tableInwardPaymentCancel  bill="#{commonReport.userInwardPaymentCancelBillsOwn}" />

                    <p:spacer height="30"/>

                    <h:panelGrid columns="2" style="min-width: 100%;">
                        <h:outputLabel value="Final Credit Total : "/>
                        <h:outputLabel style="font-weight: bold;text-align:right;float: right; " value="#{commonReport.finalCreditTotal}">
                            <f:convertNumber pattern="#,##0.00" />
                        </h:outputLabel>
                        <h:outputLabel value="Final Credit Card Total : "/>
                        <h:outputLabel style="font-weight: bold;text-align:right;float: right; " value="#{commonReport.finalCreditCardTotal}">
                            <f:convertNumber pattern="#,##0.00" />
                        </h:outputLabel>
                        <h:outputLabel value="Final Cheque Total : "/>
                        <h:outputLabel value="#{commonReport.finalChequeTot}" style="font-weight: bold;text-align:right;float: right; "   >
                            <f:convertNumber pattern="#,##0.00" />
                        </h:outputLabel>
                        <h:outputLabel value="Final Slip Total : "/>
                        <h:outputLabel  value="#{commonReport.finalSlipTot}" style="font-weight: bold;text-align:right;float: right; "  >
                            <f:convertNumber pattern="#,##0.00" />
                        </h:outputLabel>
                        <h:outputLabel value="Final Cash Total : "/>
                        <h:outputLabel style="font-weight: bold;text-align:right;float: right; " value="#{commonReport.finalCashTotal}">
                            <f:convertNumber pattern="#,##0.00" />
                        </h:outputLabel>
                    </h:panelGrid>

                </p:panel>
            </h:form>
        </h:panelGroup>
    </ui:define>

</ui:composition>
